package com.gzist.aidemo.entity.model;

import lombok.Data;

import java.util.List;


/**
 * chat请求体封装
 */
import lombok.Data;
import java.util.List;

/**
 * chat请求体封装
 */
@Data
public class ChatRequest {
    // 模型名称(默认为免费的)
    private String model = "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B";
    // 消息列表
    private List<Message> messages;
    // 是否流式返回(默认是)
    private boolean stream = true;
    // 最大token数
    private int max_tokens = 2048;
    // 停止词
    private List<String> stop;
    // 随机程度
    private double temperature = 0.7;
    private double top_p = 0.7;
    private int top_k = 50;
    private double frequency_penalty = 0.5;
    private int n = 1;
    // 指定响应格式
    private ResponseFormat response_format = new ResponseFormat("text");
    // 模型调用的工具列表
    private List<Tool> tools;  // 新增字段

    @Data
    public static class ResponseFormat {
        private String type;

        public ResponseFormat(String type) {
            this.type = type;
        }
    }

    @Data
    public static class Tool {
        private String type;
        private Function function;

        @Data
        public static class Function {
            private String description;
            private String name;
            private Object parameters;  // 使用Object以支持任意参数结构
            private boolean strict;
        }
    }
}

